<template>
	<view class="content">
		    <u-notice-bar :text="text"></u-notice-bar>
			<u-swiper :list="list"  indicator indicatorMode="line" circular  @click="click"></u-swiper>
			<view>
			        <u-grid
			                :border="false"
			                col="4"
			        >
			            <u-grid-item
			                    v-for="(listItem,id) in navlist"
			                    :key="id"
								@click="goClick(id)"
			            >
			                <u-icon
			                        :customStyle="{paddingTop:20+'rpx'}"
			                        :name="listItem.name"
			                        :size="22"
			                ></u-icon>
			                <text class="grid-text">{{listItem.title}}</text>
			            </u-grid-item>
			        </u-grid>
			        <u-toast ref="uToast" />
			    </view>
			</view>
</template>

<script>
	export default {
		data() {
			return {
				text:"欢迎使用聚合盒子",
				list: [
					'https://cdn.uviewui.com/uview/swiper/swiper1.png',
					'https://cdn.uviewui.com/uview/swiper/swiper2.png',
					'https://cdn.uviewui.com/uview/swiper/swiper3.png',
				],
				navlist: [{
						name: 'file-text',
						title: '早报',
						id:0
					},
					{
						name: 'man',
						title: '美图',
						id:1
					}
				],
			}
		},
		onLoad() {
			this.getListy()
		},
		methods: {
			click(){
				
			},
			getListy(){
				uni.request({
					url: 'https://api.2xb.cn/zaob',
					header: {
						'content-type': 'application/x-www-form-urlencoded' //自定义请求头信息
					},
					method: 'GET',

					//请求成功后返回
					success: (res) => {
						// 请求成功之后将数据给Info
						
					}
				})
			},
			goClick(e){
				console.log(e)
				if(e==0){
					uni.$u.route('/pages/porningPost/porningPost');
				}else if(e==1){
					uni.$u.route('/pages/temptationMito/temptationMito');
				}
			}
		}
	}
</script>

<style scoped lang="scss">
.content{
	padding: 0 24rpx;
}
.u-swiper{
	margin: 16rpx 0;
}
</style>
